package com.foreknow.demo1;

/**
 * 数据类型的转换
 * byte---->short---->int---->long---->float---->double      char---->int
 */
public class DataTypeConvert {
    public static void main(String[] args) {
        byte b = 28;
        int a = b;//自动类型转换
        int c = 123;
        double d = c;
        System.out.println(a);
        System.out.println(d);

        float e = 3.14f;
        double f = 3.1415926;
        int g = (int) f; // 强制转换类型
        System.out.println(g);
    }
}
